﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace vncom
{
    public class GlobalHelper
    {
        public static long N_ConvertDateTimeToTimestamp(DateTime date)
        {

            long epoch = (date.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
            return epoch;
        }

        public static bool FindRole(string[] roles, string role)
        {
            bool fl = false;
            for (int i = 0; i < roles.Length; i++)
            {
                if (roles[i] == role)
                {
                    fl = true;
                    break;
                }
            }
            return fl;
        }
    }
}